<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<title>Resource Selection-<%#actionname%>
		-<%#propertyname%></title>
	<STYLE><%#stylesheet%>
	</STYLE>
	<body marginheight="0" marginwidth="0" topmargin="0" onload="init();" bgcolor="WhiteSmoke">
		<form name="frm_service" method="post">
								
						<Table  ID="Table1" width="100%" bgcolor="WhiteSmoke" border=0 cellspacing="0" cellpadding="0" >
							<tr height=20><td colspan=6></td></tr>
							<TR>
								<TD >Protocol</TD>
								<TD colspan=4>
								<select name="Protocol" OnChange="javascript:checkSelection();">
								<OPTION value="FTP">FTP-HTTP</OPTION>
								<OPTION VALUE="FILE">FILE</OPTION>	
								</select>
								</TD>
							</TR>
							<Tr height=30><td></td></tr>
							<tr>
								<TD width="15%">Location</TD>
								<td width="10%">
									<SELECT id="Select2" name="Select2">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td width="20%">
									<SELECT id="Select3" name="Select3" language="javascript" onchange="return Select_onclick('Select3','expr2','7');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr2" WIDTH=40%>&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select5" name="Select5">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</tr>
							<tr>
								<TD >Pattern</TD>
								<td>
									<SELECT id="Select21" name="Select21">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td width="10%">
									<SELECT id="Select22" name="Select22" language="javascript" onchange="return Select_onclick('Select22','expr7','2');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr7" width="45%">&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select24" name="Select24">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</tr>
							</table>
							
							
							<div id="testDiv1"  name="testDiv1" style="visibility:visible" width=100%>
							<TABLE  width=100% bgcolor="WhiteSmoke" border=0 cellspacing="0" cellpadding="0" ID="Table3" border=0>
							
							<TR>
								<TD  width="15%">UserName</TD>
								<td width="10%">
									<SELECT id="Select6" name="Select6">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td width="20%">
									<SELECT id="Select7" name="Select7" language="javascript" onchange="return Select_onclick('Select7','expr3','3');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr3" width="40%">&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select9" name="Select9">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</TR>
							<TR>
								<TD >Password</TD>
								<td>
									<SELECT id="Select10" name="Select10">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td>
									<SELECT id="Select11" name="Select11" language="javascript" onchange="return Select_onclick('Select11','expr4','4');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr4"  width="40%">&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select13" name="Select13">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</TR>
							<TR>
								<TD >DomainName </TD>
								<td>
									<SELECT id="Select14" name="Select14">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td>
									<SELECT id="Select15" name="Select15" language="javascript" onchange="return Select_onclick('Select15','expr5','5');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr5">&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select17" name="Select17">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</TR>
							<TR>
								<TD>PortNumber</TD>
								<td>
									<SELECT id="Select18" name="Select18">
										<OPTION value=" = " selected>=</OPTION>
										<!--<OPTION value=" > ">&gt;</OPTION>
										<OPTION value=" < ">&lt;</OPTION>
										<OPTION value=" >= ">&gt;=</OPTION>
										<OPTION value=" <= ">&lt;=</OPTION>
										<OPTION value=" <> ">&lt;&gt;</OPTION>
										<OPTION value=" IN ">IN</OPTION>
										<OPTION value=" Contains ">Contains</OPTION>
										<OPTION value=" NotIn ">Not In</OPTION>-->
									</SELECT>
								</td>
								<td>
									<SELECT id="Select19" name="Select19" language="javascript" onchange="return Select_onclick('Select19','expr6','6');">
										<OPTION value="Value" selected>Value</OPTION>
										<OPTION value="Variable">Variable</OPTION>
										<OPTION value="Content">Content</OPTION>
										<OPTION value=""></OPTION>
									</SELECT>
								</td>
								<td>
									<div id="expr6">&nbsp;</div>
								</td>
								<!--<td>
									<SELECT id="Select20" name="Select20">
										<OPTION value="End" selected>End</OPTION>
										<OPTION value=" And ">And</OPTION>
										<OPTION value=" Or ">Or</OPTION>
										<OPTION value=") And ">')' And</OPTION>
										<OPTION value=") Or ">')' Or</OPTION>
									</SELECT>
								</td>-->
							</TR>
						</table>
						</div>
						<div id="testDiv2"  name="testDiv2" style="position:absolute;top:220;left:10;height:20">
							
							
							
						
						<TABLE width="85%" border=0 bgcolor="WhiteSmoke" cellspacing="0" cellpadding="0">
				<TR height=20><TD></TD></TR>		
				<TR>
								
				<TD colspan="2" align=right>
				<input type="button"  class="buttons" value='Submit' onclick="javascript:Addmode();" ID="Button1" NAME="btnAddRef">
				<input type="button" class="buttons" value="Cancel" style="width:65" ID="btnCancel" onclick="window.close();" NAME="btnCancel">
				</TD>				
			</TR>				
						<td>	
						<input type="hidden" name="_mode" value='<%#Location%>'/>
						<input type="hidden" name="_values"/>
						<input type="hidden" name="OpType" value="<%#SourceOpType%>"/>
						<input type="hidden" name="Paramvalues" value="<%#SourcePropType%>"/>
							
						</td>
																	 
		</TR>
		</TABLE>
						</DIV>
					</td></tr>
				</TABLE>
		</form>
		<script language="javascript">
		
		var i=0;
		var oexprstr;
		var sExpression="<%#sExpression%>";
		var sDispExpression="<%#sDispExpression%>";
		var iOpenBrackets=0;
		var undoExpression;
		var undoDispExpression;
		var undoOpenBrackets;
		var loc = "<%#Location%>";	
		document.frm_service._values.value="<%#UserName%>" + ";" + "<%#Password%>" + "<%#DomainName%>" + "<%#PortNumber%>" + "<%#ServerName%>" + "<%#Location>" + "<%#SourcePattern>";
		
		var valuediv7 = "<input type='text' id='valueinput7' value='<%#Location%>'></input>";
		var variablediv7 = "<SELECT id='valueinput7'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv7 += "<%#VariableXML%>";
		variablediv7 +=	"</SELECT>";
		var contentdiv7 = "<SELECT id='valueinput7'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv7 += "<%#ContentXML%>";
		contentdiv7 +=	"</SELECT>";
		var valuediv1 = "<input id='valueinput1' type='text' value='<%#Pattern>'></input>";
		var variablediv1 = "<SELECT id='valueinput1'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv1 += "<%#VariableXML%>";
		variablediv1 +=	"</SELECT>";
		var contentdiv1 = "<SELECT id='valueinput1'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv1 += "<%#ContentXML%>";
		contentdiv1 +=	"</SELECT>";
		var valuediv2 = "<input type='text' id='valueinput2' value='<%#SourcePattern%>'></input>";
		var variablediv2 = "<SELECT id='valueinput2'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv2 += "<%#VariableXML%>";
		variablediv2 +=	"</SELECT>";
		var contentdiv2 = "<SELECT id='valueinput2'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv2 += "<%#ContentXML%>";
		contentdiv2 +=	"</SELECT>";
		var valuediv3 = "<input type='text' id='valueinput3' value='<%#UserName%>'></input>";
		var variablediv3 = "<SELECT id='valueinput3'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv3 += "<%#VariableXML%>";
		variablediv3 +=	"</SELECT>";
		var contentdiv3 = "<SELECT id='valueinput3'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv3 += "<%#ContentXML%>";
		contentdiv3 +=	"</SELECT>";
		var valuediv4 = "<input type='password' id='valueinput4' value='<%#Password%>'></input>";
		var variablediv4 = "<SELECT id='valueinput4'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv4 += "<%#VariableXML%>";
		variablediv4 +=	"</SELECT>";
		var contentdiv4 = "<SELECT id='valueinput4'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv4 += "<%#ContentXML%>";
		contentdiv4 +=	"</SELECT>";


		var valuediv5 = "<input type='text' id='valueinput5' value='<%#DomainName%>'></input>";
		var variablediv5 = "<SELECT id='valueinput5'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv5 += "<%#VariableXML%>";
		variablediv5 +=	"</SELECT>";

		var contentdiv5 = "<SELECT id='valueinput5'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv5 += "<%#ContentXML%>";
		contentdiv5 +=	"</SELECT>";

		var valuediv6 = "<input type='text' id='valueinput6' value='<%#PortNumber%>'></input>";

		var variablediv6 = "<SELECT id='valueinput6'><OPTION VALUE='NONE'>NONE</OPTION>";
		variablediv6 += "<%#VariableXML%>";
		variablediv6 +=	"</SELECT>";

		var contentdiv6 = "<SELECT id='valueinput6'><OPTION VALUE='NONE'>NONE</OPTION>";
		contentdiv6 += "<%#ContentXML%>";
		contentdiv6 +=	"</SELECT>";


		var oexpr2;
		
		
		function changeDiv( divvar,strDiv )
		{
					
			oexpr2 = document.getElementsByTagName("div")[strDiv];

			oexpr2.innerHTML = eval(divvar);
		}

		function Select_onclick(strSelect,strDiv,strControl)
		{
			
			var oselect3 = document.getElementsByTagName("select")[strSelect];
			
			switch(oselect3.value)
			{
				case "Value": changeDiv("valuediv" + strControl,strDiv);
				//alert("valuediv" + strControl);
				break;
				case "Variable": changeDiv("variablediv" + strControl,strDiv);
								break;

				case "Content": changeDiv("contentdiv" + strControl,strDiv);
								break;
			}

			return false;
		}

		fillValues();
		

	function fillValues()
	{			
			var oselect3 = document.getElementsByTagName("select")['Select3'];
			var oselect22 = document.getElementsByTagName("select")['Select22'];
			var oselect7 = document.getElementsByTagName("select")['Select7'];
			var oselect11 = document.getElementsByTagName("select")['Select11'];
			var oselect15 = document.getElementsByTagName("select")['Select15'];
			var oselect19 = document.getElementsByTagName("select")['Select19'];
			oselect3.value = "Value";
			oselect22.value = "Value";
			oselect7.value = "Value";
			oselect11.value = "Value";
			oselect15.value = "Value";
			oselect19.value = "Value";
			
			Select_onclick('Select3','expr2','7');
			Select_onclick('Select22','expr7','2');
			Select_onclick('Select7','expr3','3');
			Select_onclick('Select11','expr4','4');
			Select_onclick('Select15','expr5','5');
			Select_onclick('Select19','expr6','6');
			var lsvalues = document.frm_service._values.value.split(";");
			document.getElementsByTagName("valueinput7").Value = lsvalues[0];
			document.getElementsByTagName("valueinput2").Value = lsvalues[1];
			document.getElementsByTagName("valueinput3").Value = lsvalues[2];
			document.getElementsByTagName("valueinput5").Value = lsvalues[3];
			document.getElementsByTagName("valueinput6").Value = lsvalues[4];
			document.getElementsByTagName("valueinput7").value = lsvalues[0];
			
}
			
			
		function init()
		{
			/* Select_onclick();
			Select_onchange();
			document.getElementsByTagName("input")["undo"].disabled=true;
			document.getElementsByTagName("input")["button3"].disabled=true; //Submit button initially disabled
			if( sExpression != "" )
				document.getElementsByTagName("input")["Button1"].disabled=true; //Disable Add button
			else
				document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
			show_expression(sDispExpression);*/
		}
	 function checkSelection()
	{	
		
			
	if (document.frm_service.Protocol.value == "HTTP" || document.frm_service.Protocol.value == "FTP") 
		{
			document.getElementById("testDiv1").style.visibility="visible";
		
		}
	if (document.frm_service.Protocol.value == "FILE") 
		{
			document.getElementById("testDiv1").style.visibility="hidden";
		
		}
				
	}	

		function Select1_onchange()
		{
			var oselect1 = document.getElementsByTagName("select")["Select1"];
			var odiv = document.getElementsByTagName("div")["otherinputs"];
			var o = document.getElementsByTagName("*")["valueinput"];

			var values = oselect1.value.split(",");

			switch(values[1])
			{
				case "(":  document.getElementsByTagName("select")["Select2"].disabled=true;
						document.getElementsByTagName("select")["Select3"].disabled=true;
   						document.getElementsByTagName("select")["Select5"].disabled=true;
						if( o )  o.disabled=true;
 						break;
				default:   document.getElementsByTagName("select")["Select2"].disabled=false;
						document.getElementsByTagName("select")["Select3"].disabled=false;
						document.getElementsByTagName("select")["Select5"].disabled=false;
						if( o) o.disabled=false;
						break;
			}

		}


		function get_framediv()
		{
			var framedoc;

			var frameobj;

			if(navigator.userAgent.indexOf("Netscape") >0 )
			{
				document.all = document.getElementsByTagName("iframe");
				frameobj = document.all["expr"];
				framedoc = frameobj.contentDocument.getElementsByTagName("*");
				oexprstr = framedoc["exprstr"];
			}
			else
			{
				frameobj = document.frames["expr"];
				oexprstr = frameobj.document.all["exprstr"];
			}

		}

		function show_expression(expression)
		{
			if( !oexprstr )
				get_framediv();
			oexprstr.innerHTML = expression;
		}

		function set_undovalues()
		{
			undoExpression = sExpression;
			undoDispExpression = sDispExpression;
			undoOpenBrackets = iOpenBrackets;
			document.getElementsByTagName("input")["undo"].disabled=false;
		}

		function Button1_onclick()
		{
			var retval=false;

			var oselect1 = document.getElementsByTagName("select")["Select1"];
			var select1values = oselect1.value.split(",");

			if( select1values[1] == "(" )
			{
				set_undovalues();
				sExpression += "(";
				sDispExpression += "(";
				iOpenBrackets++;
			}
			else
			{
				var oselect2 = document.getElementsByTagName("select")["Select2"];
				var oselect3 = document.getElementsByTagName("select")["Select3"];
				var oselect5 = document.getElementsByTagName("select")["Select5"];
				//var o = document.getElementsByTagName("*")["valueinput"];
				//For IE 5.5 compatibility
				if(typeof(document.getElementsByTagName("input")["valueinput"]) != 'undefined')
					var o = document.getElementsByTagName("input")["valueinput"];
				else if(typeof(document.getElementsByTagName("select")["valueinput"]) != 'undefined')
					var o = document.getElementsByTagName("select")["valueinput"];
				else
					var o = document.getElementsByTagName("*")["valueinput"];

				var endcond=false;

				if( oselect5.value.substring(0,1) == ")" ) //Incase no open brackets pending dont allow to close the bracket
					if( iOpenBrackets <= 0 )
						return retval;
					else
						iOpenBrackets--;


				if( oselect5.value == "End" )
					endcond=true;

				set_undovalues();

				sExpression += "["; sDispExpression += "[";
				sExpression += select1values[1]; sDispExpression += select1values[0];
				sExpression += "]"; sDispExpression += "]";
				sExpression += oselect2.value; sDispExpression += oselect2.value;
				sExpression += "["; sDispExpression += "[";

				if( oselect3.value != "Value" )
				{
					if(typeof(((o.value.split(","))[1])) == 'undefined')
					{
						sExpression += ((o.value.split(","))[0]);
					}
					else
					{
						sExpression += ((o.value.split(","))[1]);
					}
					sDispExpression += ((o.value.split(","))[0]);
				}
				else
				{
				 	sExpression += '"'+o.value+'"';
					sDispExpression += '"'+o.value+'"';
				}

				sExpression += "]"; sDispExpression += "]";

				if( !endcond )
				{
					sExpression += " "+oselect5.value;
					sDispExpression += " "+oselect5.value;
				}
				else
				{
					while( iOpenBrackets > 0)
					{
						sExpression += ")"; sDispExpression += ")";
						iOpenBrackets--;
					}
					document.getElementsByTagName("input")["button3"].disabled=false; //Enable submitt button
					document.getElementsByTagName("input")["Button1"].disabled=true; //Disable Add button
				}
			}
			show_expression(sDispExpression);
			return retval;
		}
			
		function SetParamValue(asValue,obj)
		{
		  if (asValue=="")return;
		  var lsvalue;
		  lsvalue = asValue.split(";");
		  SetOpValue(lsvalue[0],document.frm_service.Select3,lsvalue[0]);
		  Select_onclick('Select3','expr2','7');
		  if (lsvalue[0].toUpperCase() != "VALUE"){	
	 	  SetOpValue("<%#Location%>",document.frm_service.valueinput7);
		  }	
		  
		  SetOpValue(lsvalue[1],document.frm_service.Select22);	
		  Select_onclick('Select22','expr7','2');
		   if (lsvalue[1].toUpperCase() != "VALUE"){			
		   SetOpValue("<%#SourcePattern%>",document.frm_service.valueinput2);
			}
		  
		  SetOpValue(lsvalue[2],document.frm_service.Select7 );			  			
		  Select_onclick('Select7','expr3','3');	
		   if (lsvalue[2].toUpperCase() != "VALUE"){	
		  SetOpValue("<%#UserName%>",document.frm_service.valueinput3);}
                  
		  SetOpValue(lsvalue[3],document.frm_service.Select11 );			  			
		  Select_onclick('Select11','expr4','4');		
		   if (lsvalue[3].toUpperCase() != "VALUE"){	 
		  SetOpValue("<%#Password%>",document.frm_service.valueinput4);}
		 
		  SetOpValue(lsvalue[4],document.frm_service.Select15 );	
  		  Select_onclick('Select15','expr5','5');
		   if (lsvalue[4].toUpperCase() != "VALUE"){	
		  SetOpValue("<%#DomainName%>",document.frm_service.valueinput5);}	
		  
		  SetOpValue(lsvalue[5],document.frm_service.Select19 );	
		  Select_onclick('Select19','expr6','6');
		  if (lsvalue[5].toUpperCase() != "VALUE"){	
		  SetOpValue("<%#PortNumber%>",document.frm_service.valueinput6); }
		 }
		
		function SetOpValue(asValue,obj)
		{
			var lobjOp = obj;	
			if (typeof(lobjOp.options)=='undefined') return;
			var licount;
			var lbret=0;
			obj.selectedIndex=0;
			
			for(licount=0;licount<lobjOp.options.length;licount++)
			{
				if (lobjOp.options[licount].value == asValue) 
				{
					lobjOp.selectedIndex = licount;
				        lbret =1;      
				}  
			}
			
			checkSelection();
			
		}
		
		function Button2_onclick()
		{
			sExpression="";
			sDispExpression="";
			iOpenBrackets=0;
			document.getElementsByTagName("input")["button3"].disabled=true; //Submit button enabled after clearing
			document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
			show_expression(sDispExpression);
		}

		function undo_onclick()
		{
			sExpression = undoExpression;
			sDispExpression = undoDispExpression;
			iOpenBrackets = undoOpenBrackets;
			document.getElementsByTagName("input")["undo"].disabled=true; //Disable undo button
			document.getElementsByTagName("input")["button3"].disabled=true; //Disable Submit button
			document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
			show_expression(sDispExpression);
		}

		function ConvertToString(  number,  width )
		{
			var str="";
			var i;

			str=number.toString();
			var l = str.length;
			for(i=0;i<(width-l);i++)
			{
				str = "0" + str;
			}
			return str.substring(0,width);
		}

		function submitform()
		{
			var submitvalue="";
			submitvalue = ConvertToString( sExpression.length, 4 ) + sExpression + ConvertToString( sDispExpression.length, 4) + sDispExpression;
			window.opener.properties("_hidtempstore",submitvalue);			
			window.opener.submitform("?mode=edit&<%#qspropertypagename%>=<%#propertypage%>&<%#qspropertyname%>=<%#propertyname%>&<%#SelectedItemQueryString%>");
			window.close();
		}
	/* function ReplaceDemo(var location){
 	  var r, re;                   //Declare variables.
	   var ss = location;
	   
	   re = /The/g;                //Create regular expression pattern.
	   r = ss.replace(re, "A");    //Replace "The" with "A".
	   return(r);                  //Return string with replacement made.
	}*/


	function Addmode()
	{
		var location = document.frm_service.valueinput7.value;
		
		
		var sourcepattern = document.frm_service.valueinput2.value;	
		var UsrName=document.frm_service.valueinput3.value;
		var password = document.frm_service.valueinput4.value;
		var domainname = document.frm_service.valueinput5.value;
		var servername = document.frm_service.valueinput4.value;
		var portnumber= document.frm_service.valueinput6.value;
		var lsSubmit;
		var submitvalue = "";
	 		
		if(document.frm_service.Protocol.value == "FILE")
		{
			
			UsrName = "";
			password = "";
			domainname = "";
			servername = "";				
			portnumber="";

		}	
	        submitvalue = ConvertToString( UsrName.length, 4 ) + UsrName + ConvertToString( password.length, 4) + password;
		submitvalue = submitvalue + ConvertToString( domainname.length, 4 ) + domainname;
		submitvalue = submitvalue + ConvertToString( location.length, 4 ) + location;
		submitvalue = submitvalue + ConvertToString( sourcepattern.length, 4 ) + sourcepattern; 
		submitvalue = submitvalue + ConvertToString( servername.length, 4 ) + servername;
		submitvalue = submitvalue + ConvertToString( portnumber.length, 4 ) + portnumber;
		submitvalue = submitvalue + ConvertToString( document.frm_service.Protocol.value.length, 4 ) + document.frm_service.Protocol.value;
		submitvalue = submitvalue + ConvertToString( document.frm_service.Protocol.value.length, 4 ) + document.frm_service.Protocol.value;
		lsSubmit =  document.frm_service.Select3.value + ";" + document.frm_service.Select22.value + ";" + document.frm_service.Select7.value  + ";" + document.frm_service.Select11.value + ";" + document.frm_service.Select15.value + ";" + document.frm_service.Select19.value; 
		submitvalue = submitvalue + ConvertToString( lsSubmit.length, 4 ) +lsSubmit;  
		submitvalue = submitvalue + ConvertToString( lsSubmit.length, 4 ) +lsSubmit;  
		
		window.opener.properties("_hidtempstore",submitvalue);
		window.opener.submitform("?mode=edit&<%#qspropertypagename%>=<%#propertypage%>&<%#qspropertyname%>=<%#propertyname%>&<%#SelectedItemQueryString%>");
		window.close();  
	}
	
	SetOpValue(document.frm_service.OpType.value,document.frm_service.Protocol);	
	SetParamValue(document.frm_service.Paramvalues.value);
	
	    </script>
	<STYLE>
	.main {
	padding: 2px 0px 2px 5px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #000000;
	background-color: #A4B8F3;
	border: none;
}
.onclick {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	background-color: #50639A;
	padding-top: 5px;
	padding-right: 0px;
	padding-bottom: 5px;
	padding-left: 5px;
	color: #FFFFFF;
}
.button {
	background-color: #899BCF;
	border-top-style: outset;
	border-right-style: inset;
	border-bottom-style: outset;
	border-left-style: outset;
	border-top-color: #BDCCF8;
	border-right-color: #BDCCF8;
	border-bottom-color: #000000;
	border-left-color: #000000;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	padding-top: 5px;
	padding-right: 0px;
	padding-bottom: 5px;
	padding-left: 2px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #FFFFFF;
}
.titlesmain {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #FFFFFF;
	background-color: #50639A;
	padding-top: 2px;
	padding-right: 0px;
	padding-bottom: 2px;
	padding-left: 5px;
}
.subtitles {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	color: #FFFFFF;
	background-color: #8296CF;
	padding-top: 2px;
	padding-right: 0px;
	padding-bottom: 2px;
	padding-left: 5px;
}
.toolbartable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolbartext
{
	font-size: 12px;
	font-family: Verdana,Tahoma;
	font-weight:bolder;
	color: Black;
}
.toolbarselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.toolbarbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:Black;
    border-color:Silver;
}
.toolbartitleheading
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
}
.toolbartitle
{
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
	text-align:right;
	font-weight:bolder;
}


.toolboxtable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxinternaltable
{
	background:  #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.toolboxheading
{
	background: black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.toolboxcolumn
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR:  #889CD5;
    color:white;
    border-color:White;	
    border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}
.toolboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:white;   
    border-color:White;
}
.toolboxparent
{
	background:  #C4D2FB;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: black;
	font-weight:bolder;
	text-align:left;
}
.toolboxparentbevell
{
	background:  #50639A;
	font-size: 11px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:left;
	border-top: 1px ridge #C6B36C;
	border-right: 1px ridge #413400;
	border-bottom: 1px ridge #413400;
	border-left: 1px ridge #C6B36C;
}


.imagetable
{
	background: #C4D2FB;
}
.imageiframe
{
	background: #FFFF66;
}



.propertiesboxtable
{
	background: #889CD5;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxheading
{
	background: Black;
	font-size: 12px;
	font-family: Verdana, Tahoma;
	color: White;
	font-weight:bolder;
	text-align:center;
}
.propertiesboxactionselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxbuttons
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #cccccc;
    color:black;
    border-color:silver;	
}
.propertiesboxpropertytable
{
	background: Silver;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;	
}
.propertiesboxpropertyextraspace
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxpropertybuttonstable
{
	background:  #C4D2FB;
	font-size: 15px;
	font-family: Verdana,Tahoma;
	color: Black;
}
.propertiesboxinput
{
	FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
}
.propertiesboxselect
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
}
.propertiesboxpropertytitle
{
	font-size: 11px;
	font-family: Verdana,Tahoma;
	font-weight:normal;
	background: #C4D2FB;
}
.propertiesboxinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 0px #737373 solid;
	text-decoration: none;
}
.propertiesboxinputstable
{
	background: White;
	font-size: 11px;
	font-family: Verdana,Tahoma;
	color: Black;	
}
.propertiesboxinputbutton
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #889CD5;
    color:White;
    border-color:White;	
}



TD
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma
}
A
{
    COLOR: navy
}
.linkinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 200px
}
.returninputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid;
    width: 150px
}
.inputs
{
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma;
    text-decoration: none;
    border: 1px #737373 solid
}
.lockedinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
    BACKGROUND-COLOR: #DBEAF5;
}
.buttons
{
    FONT-SIZE: 11px;
        FONT-FAMILY: Verdana,Tahoma;
        BACKGROUND-COLOR: #cccccc;
        color:black;
    border-color:silver;
}
.pageheader
{
    FONT-WEIGHT: bold;
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana,Tahoma
}
.properties
{
    FONT-SIZE: 11px;
    COLOR: maroon;
    FONT-FAMILY: Verdana,Tahoma
}
.list
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Tahoma
}
.propertyselected
{
    BACKGROUND-COLOR: midnightblue
}
.propertytableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
	text-decoration: none
}
.propertypage
{
	background-color : #93BEE2;
}
.controlbg
{
	background-color : #93BEE2;
}
.gridtableinputs
{
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana,Tahoma;
	border: 1px solid white;
}
.gridanchor
{
    FONT-SIZE: 10px;
    FONT-FAMILY: Verdana,Tahoma;
	text-decoration:none;
}
.rowcol
{
	background-color : #faebd7;
}
.rowcol1
{
	background-color : e5e5e5;
}</STYLE>
	</body>
</html>